import request from '#/utils/requestAbort';

export async function settlementDatas(data, provinceId) {
  const url = `${
    provinceId === '23' ? '/private-business' : '/clearing-settlement'
  }/settlementManage/settlementDatas`;
  return request(url, {
    method: 'post',
    data,
  });
}

export async function exportExcel(data, provinceId) {
  const url = `${
    provinceId === '23' ? '/private-business' : '/clearing-settlement'
  }/longTermDecomposition/exportExcel`;
  return request(url, {
    method: 'post',
    data,
    responseType: 'blob',
    getResponse: true,
  });
}

// 查询可选日期
export async function getOptionalDate(data) {
  const url = `${
    data.provinceId === '23' ? '/private-business' : '/clearing-settlement'
  }/settlementManage/date`;
  return request(url, {
    method: 'POST',
    data,
  });
}
// 省份-交易中心-场站（数据权限）
export async function queryMarketList(menuCode) {
  return request(`/power/dataPower/common/${menuCode}/t_station`, {
    method: 'GET',
  });
}

// 导出文件接口-用于预览pdf的时候调用
export async function downLoadFile(fileId) {
  return request(`/annex/annex/downLoadFile/${fileId}`, {
    method: 'GET',
    responseType: 'blob',
  });
}
